<template>
  <div>
    <!-- {{FilterType}} -->
    <label >
    <input type="radio" :checked="filterType === FilterType.ALL" @change="() => selectFilter(FilterType.ALL)"> 
      全部 
    </label>

    <label>
      <input type="radio" :checked="filterType === FilterType.FINISHED" @change="() => selectFilter(FilterType.FINISHED)"> 
      已完成
    </label>

    <label>
      <input type="radio" :checked="filterType === FilterType.UNFINISHED" @change="() => selectFilter(FilterType.UNFINISHED)"> 
      未完成
    </label>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import {FilterType} from './type.d.ts'

export default defineComponent({
  props: {
    filterType: Number
  },
  emits: ['selectFilter'],
  setup(_, {emit}) {

    const selectFilter = (e: any) => {
      emit("selectFilter", e)
    }

    return {
      FilterType,
      selectFilter
    }
  },
})
</script>